import time
from selenium import webdriver
driver = webdriver.Chrome(r'D:\tools\chromedriver_win32\chromedriver.exe') #百度这个插件,下载才能生效

driver.get('https://www.baidu.com/')

input1 = driver.find_element_by_id('kw')
input1.send_keys(' 王菲')

btn = driver.find_element_by_id('su')
btn.click()

time.sleep(1)
res = driver.find_element_by_id('1')
print(res.text)

if '职业：歌手、演员' in res.text:
    print('pass')
else:
    print('fail')